package com.ruoyi.project.bill.service.impl;

import java.util.List;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.project.bill.domain.BillListener;
import com.ruoyi.project.bill.mapper.BillListenerMapper;
import com.ruoyi.project.bill.service.IBillListenerService;
import lombok.extern.slf4j.Slf4j;
import io.jsonwebtoken.lang.Collections;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 单据动作监听Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-03
 */
@Service
@Slf4j
public class BillListenerServiceImpl extends ServiceImpl<BillListenerMapper, BillListener> implements IBillListenerService
{
    @Autowired
    private BillListenerMapper billListenerMapper;


    /**
     * 查询单据动作监听
     * 
     * @param id 单据动作监听主键
     * @return 单据动作监听
     */
    @Override
    public BillListener selectBillListenerById(String id)
    {
        return billListenerMapper.selectBillListenerById(id);
    }

    /**
     * 批量查询ids
     */
    @Override
    public List<BillListener> selectBillListenerByIds(String[] ids)
    {
        return billListenerMapper.selectBillListenerByIds(ids);
    }

    /**
     * 查询单据动作监听列表
     * 
     * @param billListener 单据动作监听
     * @return 单据动作监听
     */
    @Override
    public List<BillListener> selectBillListenerList(BillListener billListener)
    {
        return billListenerMapper.selectBillListenerList(billListener);
    }

    /**
     * 新增单据动作监听
     * 
     * @param billListener 单据动作监听
     * @return 结果
     */
    @Override
    public String insertBillListener(BillListener billListener)
    {
        int code1= billListenerMapper.insert(billListener);
    return code1>0? null:"保存失败";
    }

    /**
     * 修改单据动作监听
     * 
     * @param billListener 单据动作监听
     * @return 结果
     */
    @Override
    public String updateBillListener(BillListener billListener)
    {
        int code1= billListenerMapper.updateById(billListener);
        return code1>0? null:"保存失败";
    }

    /**
     * 批量删除单据动作监听
     * 
     * @param ids 需要删除的单据动作监听主键
     * @return 结果
     */
    @Override
    public String deleteBillListenerByIds(String[] ids)
    {
        int code = billListenerMapper.deleteBatchIds(Collections.arrayToList(ids));
        return code>0?null:"删除失败";
    }

    /**
     * 删除单据动作监听信息
     * 
     * @param id 单据动作监听主键
     * @return 结果
     */
    @Override
    public String deleteBillListenerById(String id)
    {
        int code= billListenerMapper.deleteById(id);
        return code>0?null:"删除失败";
    }


}
